package com.neu.demo02.controller;

import com.neu.demo02.dto.UserInfoDto;
import com.neu.demo02.service.UserInfoService;
import com.neu.demo02.util.CommonResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
//表示允许跨域
@CrossOrigin
@RestController
@RequestMapping("/user")
public class UserInfoController {

    @Resource
    private UserInfoService userInfoService;
    @RequestMapping("/findUsers")
    public CommonResult findUsers(@RequestBody UserInfoDto dto){
        return userInfoService.findUsers(dto);
    }
    @RequestMapping("/reg")
    public CommonResult reg(@RequestBody UserInfoDto dto){
        return userInfoService.doSave(dto);
    }

}
